#!/usr/bin/python3

from __future__ import absolute_import

import sys

from six.moves import configparser


def main():
    _, exclude_term = sys.argv

    config = configparser.ConfigParser()
    config.readfp(sys.stdin)

    for section in config.sections():
        if section == 'main':
            continue
        config.set(section, 'exclude', exclude_term)
    config.write(sys.stdout)


if __name__ == '__main__':
    sys.exit(main() or 0)
